package com.example.chatchatbackend.entity.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author 丁真
 * @since 2024-10-28 05:03:47
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("db_shopping")
public class Shopping implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 商品id
     */
    private String productId;

    /**
     * 发货地址
     */
    private String address;

    /**
     * 发货状态 0未发货 1已发货 2已送达 3已收货
     */
    private String status;

    /**
     * 跟踪发货单
     */
    private Integer trackingNumber;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime createdTime;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime updateTime;

    private String productName;
    private BigDecimal price;
    private Integer customerId;



    public Shopping(Integer id, String productId, String address, String status, Integer trackingNumber, LocalDateTime createdTime, LocalDateTime updateTime, Integer customerId) {
        this.id = id;
        this.productId = productId; // 赋值 productId
        this.address = address; // 赋值 address
        this.status = status; // 赋值 status
        this.trackingNumber = trackingNumber; // 赋值 trackingNumber
        this.createdTime = createdTime; // 赋值 createdTime
        this.updateTime = updateTime; // 赋值 updateTime
        this.customerId = customerId; // 赋值 customerId
    }
}
